numlist = []
for x in range(1000):
    if x % 3 == 0 or x % 5 == 0 :
        numlist.append(x)
print(sum(numlist))


total = sum([x for x in range(1000) if x % 3 == 0 or x % 5 == 0])

print(f"The total value is {total}")